package com.library.management.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/api/test")
public class TestController {

    @GetMapping("/status")
    public Map<String, Object> getStatus() {
        Map<String, Object> response = new HashMap<>();
        response.put("status", "success");
        response.put("message", "图书管理系统后端服务运行正常");
        response.put("timestamp", System.currentTimeMillis());
        response.put("data", Map.of(
                "version", "1.0.0",
                "environment", "development"
        ));
        return response;
    }

    @GetMapping("/public")
    public Map<String, String> publicEndpoint() {
        return Map.of(
                "message", "这是一个公开访问的端点",
                "access", "无需认证"
        );
    }
}